<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'product-form',
	'enableAjaxValidation'=>true,
	'htmlOptions' => array('enctype' => 'multipart/form-data'), 
)); ?>
	<?php echo Yii::t('admin','<p class="note">Fields with <span class="required">*</span> are required.</p>');?>	
	<?php echo $form->errorSummary($model); ?>	
	
	
	<div class="column1" style="margin:0px;">
		<div class="row">
			<?php echo $form->labelEx($model,'pro_name'); ?>
			<?php echo $form->textField($model,'pro_name',array('size'=>60,'maxlength'=>200)); ?>
			<?php echo $form->error($model,'pro_name'); ?>
		</div>
		<div class="row">
			<?php echo $form->labelEx($model,'pro_price'); ?>
			<?php echo $form->textField($model,'pro_price',array('size'=>18,'maxlength'=>18)); ?>
			<?php echo $form->error($model,'pro_price'); ?>
		</div>	
		<div class="row">
			<?php echo $form->labelEx($model,'pro_cid'); ?>
			<?php echo $form->dropDownList($model,'pro_cid',Category::model()->getCategoryDropdownList(Category::CATEGORY_PRODUCT)); ?>
			<?php echo $form->error($model,'pro_cid'); ?>
		</div>
	</div>
	<div class="column2" style="margin-top:0px;width:50%;">
		<div class="row" style="text-align:center;">
			
			<?php if($model->pro_pic_id):?>
				<img alt="folder" id="pro_pic_id" src="<?php echo File::model()->generateFilePath(File::model()->findByPk($model->pro_pic_id, $params),0)?>">
			<?php else:?>
				<img alt="folder" id="pro_pic_id" src="/public/images/folder.png" width="100";>
			<?php endif;?>
			<br />
			<?php if($model->pro_pic_id):?>
				<a href="#" class="various1" title="上传产品样图">继续增加产品样图</a>
			<?php elseif ($model->pro_id):?>
				该产品还未增加产品样图，<a href="#" class="various1" title="上传产品样图">现在增加</a>
			<?php else:?>
				信息增加完成后，增加产品样图，并设置封面。			
			<?php endif;?>	
		</div>	
	</div>
	<div class="clear"></div>
	<div class="row column3 left">
		<?php echo $form->labelEx($model,'pro_status'); ?>
		<?php echo $form->dropDownList($model,'pro_status',Product::model()->generateStatusStateDropdownList()); ?>
		<?php echo $form->error($model,'pro_status'); ?>
	</div>
		
	<div class="row column3 left">
		<?php echo $form->labelEx($model,'pro_recommend'); ?>
		<?php echo $form->dropDownList($model,'pro_recommend',Product::model()->generateRecommendStateDropdownList()); ?>
		<?php echo $form->error($model,'pro_recommend'); ?>
	</div>
	<div class="row column3 left">
		<?php echo $form->labelEx($model,'pro_iscomment'); ?>
		<?php echo $form->dropDownList($model,'pro_iscomment',Product::model()->generateCommentStateDropdownList()); ?>
		<?php echo $form->error($model,'pro_iscomment'); ?>
	</div>
	
	<div class="clear"></div>
	<div class="row column3 first">
		<?php echo $form->labelEx($model,'pro_left'); ?>
		<?php echo $form->textField($model,'pro_left'); ?>
		<?php echo $form->error($model,'pro_left'); ?>
	</div>
	
	<div class="row column3">
		<?php echo $form->labelEx($model,'pro_sold'); ?>
		<?php echo $form->textField($model,'pro_sold'); ?>
		<?php echo $form->error($model,'pro_sold'); ?>
	</div>
	
	<div class="row column3">
		<?php echo $form->labelEx($model,'pro_discount'); ?>
		<?php echo $form->textField($model,'pro_discount'); ?>
		<?php echo $form->error($model,'pro_discount'); ?>
	</div>	
	<div class="clear"></div>
	<div class="row">
		<?php echo $form->labelEx($model,'pro_describe'); ?>
		<?php echo $form->textArea($model,'pro_describe',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'pro_describe'); ?>
	</div>	
	<hr class="space" />
	<div class="row buttons">
		<?php $this->widget('zii.widgets.jui.CJuiButton',
				array(
					'name'=>'button',
					'buttonType'=>'button',
					'htmlOptions'=>array(
						'id'=>'product_submit'
					),
					'caption'=>$model->isNewRecord ? Yii::t('admin', 'Create') : Yii::t('admin', 'Save'),
						///'onclick'=>'js:function(){alert("Save button clicked"); this.blur(); return false;}',
				)
			);
		?>	
	</div>
	<hr class="space" />
	<div class="note">
		<ol>
			此处有以下问题存在：
			<li>增加相片时，上传虽然能正常进行，但却不能正常显示进度</li>
			<li>相片上传过后，可能需要强制刷新才能退出</li>
		</ol>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->